1. Field
The present embodiments relate to techniques for executing an application. More specifically, the present embodiments relate to a method and system for implementing efficient per-thread safepoints and local access for the application.
2. Related Art
Software runtime systems may include safepoints at which threads are stopped to enable operations such as walking the threads' execution stacks, garbage collection, and deoptimizing runtime method representations to be performed. Furthermore, safepoints may be implemented using a variety of methods. For example, each safepoint may include a polling instruction that is executed every time a thread passes through the safepoint. The polling instruction may also be used to stop the thread when the safepoint is triggered. Alternatively, the thread may be stopped by dynamically inserting code patches at one or more safepoints.
The highly competitive nature of software runtime environments has also led to a push for improved runtime performance within each runtime environment. However, current safepoint techniques are associated with a number of drawbacks that may adversely affect such runtime performance. In particular, both polling safepoints and code patches may be unable to stop individual threads while maintaining minimal mutator overhead and/or acceptable space overhead. Consequently, requirements for both versatility and efficiency may be difficult to satisfy using conventional safepoint implementations.